/**
 *	@author Juntalis
 */

function _resetBotScript() {
	Bot.Scripted = {
		Settings : {
			override : false
		},
		Connect : null,
		Disconnect : null,
		ServerMessage: null,
		UserSay : null,
		UserWhisper : null,
		UserJoin : null,
		UserLeave : null,
		Input : null
	};
}

var Auth = {
	"player" : 0,
	"oldschool" : 1,
	"operator" : 2,
	"owner" : 3
};

function User() {
	this.ID = 0;
	this.Name = "";
	this.Clan = "";
	this.PreClan = "";
	this.WholeName = function() { return this.Name + "[" + this.Clan + "]" + this.PreClan };
	this.Rank = 0;
	this.Auth = 0;
	this.Wins = 0;
	this.Losses = 0;
}

var ChatBox = {
	WriteLine : function(str) {
		if($("#TxtIn").length>0) {
			str = str.EscapeHtml();
			str = str
				.replace(/\[b\](.*?)\[\/b\]/ig, "<strong>$1</strong>")
				.replace(/\[i\](.*?)\[\/i\]/ig, "<em>$1</em>")
				.replace(/\[u\](.*?)\[\/u\]/ig, "<u>$1</u>")
				.replace("[]","<>").replace("[/]","</>")
				.replace(/\[color=(.*?)\](.*?)\[\/color\]/ig, '<font color="$1">$2</font>')
			$("#TxtIn")
				.append("<br />")
				.append(str)
				.scrollTo("100%");
		}
	}
}
